<%-- 
    Document   : flightManage
    Created on : Aug 31, 2011, 8:51:08 PM
    Author     : HIEP
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<!DOCTYPE html>
<div id="content" class="roundedBorders">
    <!-- Title -->
    <div id="title" class="b2">
        <h2>Car Rental Analysis</h2>
    </div>

    <!-- Title -->
    <!-- Inner Content -->
    <div id="innerContent">
        <p class="intro">
            Analysis with Car Model & Car Type!
        </p>
        <!-- ListTable -->
        <table cellspacing="0" class="listTable" id="postList" style="width: 49%; margin-right: 10px;">
            <!-- Thead -->
            <thead>
                <tr>
                    <th class="first"><div></div></th>
            <th><a href="#">Car Model</a></th>
            <th class="last"><a href="#">Rental Total</a></th>
            </tr>
            </thead>
            <!-- /Thead -->
            <!-- Tfoot -->
            <tfoot>
                <tr>
                    <td colspan="6">
                        <div class="inner">
                            <div class="paginate">
                            </div>
                        </div>
                    </td>
                </tr>
            </tfoot>
            <!-- /Tfoot -->
            <!-- Tbody -->
            <tbody>
                <logic:notEmpty name="carModels">
                    <logic:iterate name="carModels" id="item">
                        <tr>
                            <td><input type="checkbox" class="checkbox"/></td>
                            <td> <bean:write name="item" property="name"/> </td>
                            <td>
                                <c:set var="total" value="0"/>
                                <logic:notEmpty name="carBookings">
                                    <logic:iterate name="carBookings" id="book">
                                        <logic:notEmpty name="cars">
                                            <logic:iterate name="cars" id="car">
                                                <c:if test="${book.carId == car.id}">
                                                    <c:if test="${car.id == item.id}">
                                                        <c:set var="total" value="${total + book.price}"/>
                                                    </c:if>
                                                </c:if>
                                            </logic:iterate>
                                        </logic:notEmpty>
                                    </logic:iterate>
                                </logic:notEmpty>
                                ${total} $
                            </td>
                        </tr>
                    </logic:iterate>
                </logic:notEmpty>
            </tbody>
            <!-- /Tbody -->
        </table>
        <table cellspacing="0" class="listTable" id="postList" style="width: 49%;">
            <!-- Thead -->
            <thead>
                <tr>
                    <th class="first"><div></div></th>
            <th><a href="#">Car Type</a></th>
            <th class="last"><a href="#">Rental Total</a></th>
            </tr>
            </thead>
            <!-- /Thead -->
            <!-- Tfoot -->
            <tfoot>
                <tr>
                    <td colspan="6">
                        <div class="inner">
                            <div class="paginate">
                            </div>
                        </div>
                    </td>
                </tr>
            </tfoot>
            <!-- /Tfoot -->
            <!-- Tbody -->
            <tbody>
                <logic:notEmpty name="carTypes">
                    <logic:iterate name="carTypes" id="item">
                        <tr>
                            <td><input type="checkbox" class="checkbox"/></td>
                            <td> <bean:write name="item" property="name"/> </td>
                            <td>
                                <c:set var="total" value="0"/>
                                <logic:notEmpty name="carBookings">
                                    <logic:iterate name="carBookings" id="book">
                                        <logic:notEmpty name="cars">
                                            <logic:iterate name="cars" id="car">
                                                <c:if test="${book.carId == car.id}">
                                                    <c:if test="${car.id == item.id}">
                                                        <c:set var="total" value="${total + book.price}"/>
                                                    </c:if>
                                                </c:if>
                                            </logic:iterate>
                                        </logic:notEmpty>
                                    </logic:iterate>
                                </logic:notEmpty>
                                ${total} $
                            </td>
                        </tr>
                    </logic:iterate>
                </logic:notEmpty>
            </tbody>
            <!-- /Tbody -->
        </table>
        <!-- /ListTable -->	
    </div>
    <!-- /Inner Content -->
        <!-- Inner Content -->
    <div id="innerContent">
        <p class="intro">
            Analysis with Car Rental Cost & Income range of customers
        </p>
        <!-- ListTable -->
        <table cellspacing="0" class="listTable" id="postList" style="width: 49%; margin-right: 10px;">
            <!-- Thead -->
            <thead>
                <tr>
                    <th class="first"><div></div></th>
            <th><a href="#">Name</a></th>
            <th class="last"><a href="#">Total($)</a></th>
            </tr>
            </thead>
            <!-- /Thead -->
            <!-- Tfoot -->
            <tfoot>
                <tr>
                    <td colspan="6">
                        <div class="inner">
                            <div class="paginate">
                            </div>
                        </div>
                    </td>
                </tr>
            </tfoot>
            <!-- /Tfoot -->
            <!-- Tbody -->
            <tbody>
                <tr>
                    <td><input type="checkbox" class="checkbox"/></td>
                    <td>Less than 50$</td>
                    <td>
                        <c:set var="total" value="0"/>
                        <logic:notEmpty name="carBookings">
                            <logic:iterate name="carBookings" id="book">
                                <logic:notEmpty name="carLess50">
                                    <logic:iterate name="carLess50" id="car">
                                        <c:if test="${book.carId == car.id}">
                                            <c:set var="total" value="${total + book.price}"/>
                                        </c:if>
                                    </logic:iterate>
                                </logic:notEmpty>
                            </logic:iterate>
                        </logic:notEmpty>
                        ${total}
                    </td>
                </tr>
                <tr>
                    <td><input type="checkbox" class="checkbox"/></td>
                    <td>From 50$ to 100$</td>
                    <td>
                        <c:set var="total" value="0"/>
                        <logic:notEmpty name="carBookings">
                            <logic:iterate name="carBookings" id="book">
                                <logic:notEmpty name="car50To100">
                                    <logic:iterate name="car50To100" id="car">
                                        <c:if test="${book.carId == car.id}">
                                            <c:set var="total" value="${total + book.price}"/>
                                        </c:if>
                                    </logic:iterate>
                                </logic:notEmpty>
                            </logic:iterate>
                        </logic:notEmpty>
                        ${total}
                    </td>
                </tr>
                <tr>
                    <td><input type="checkbox" class="checkbox"/></td>
                    <td>From 100$ to 200$</td>
                    <td>
                        <c:set var="total" value="0"/>
                        <logic:notEmpty name="carBookings">
                            <logic:iterate name="carBookings" id="book">
                                <logic:notEmpty name="car100To200">
                                    <logic:iterate name="car100To200" id="car">
                                        <c:if test="${book.carId == car.id}">
                                            <c:set var="total" value="${total + book.price}"/>
                                        </c:if>
                                    </logic:iterate>
                                </logic:notEmpty>
                            </logic:iterate>
                        </logic:notEmpty>
                        ${total}
                    </td>
                </tr>
                <tr>
                    <td><input type="checkbox" class="checkbox"/></td>
                    <td>Greater than 200$</td>
                    <td>
                        <c:set var="total" value="0"/>
                        <logic:notEmpty name="carBookings">
                            <logic:iterate name="carBookings" id="book">
                                <logic:notEmpty name="carGreater200">
                                    <logic:iterate name="carGreater200" id="car">
                                        <c:if test="${book.carId == car.id}">
                                            <c:set var="total" value="${total + book.price}"/>
                                        </c:if>
                                    </logic:iterate>
                                </logic:notEmpty>
                            </logic:iterate>
                        </logic:notEmpty>
                        ${total}
                    </td>
                </tr>
            </tbody>
            <!-- /Tbody -->
        </table>
        <table cellspacing="0" class="listTable" id="postList" style="width: 49%;">
            <!-- Thead -->
            <thead>
                <tr>
                    <th class="first"><div></div></th>
            <th><a href="#">Name</a></th>
            <th class="last"><a href="#">Total($)</a></th>
            </tr>
            </thead>
            <!-- /Thead -->
            <!-- Tfoot -->
            <tfoot>
                <tr>
                    <td colspan="6">
                        <div class="inner">
                            <div class="paginate">
                            </div>
                        </div>
                    </td>
                </tr>
            </tfoot>
            <!-- /Tfoot -->
            <!-- Tbody -->
            <tbody>
                <tr><td colspan="3" style="text-align: right; background-color: gainsboro;">Greater than 1000$</td></tr>
                <logic:empty name="userGreater1000">
                    <tr><td colspan="3" style="font-style: italic; font-size: 11px;">There are no customer</td></tr>
                </logic:empty>
                <logic:notEmpty name="userGreater1000">
                    <logic:iterate name="userGreater1000" id="u">
                        <tr><td colspan="3"> <bean:write name="u" property="fullname"/> </td></tr>
                    </logic:iterate>
                </logic:notEmpty>

                <tr><td colspan="3" style="text-align: right; background-color: gainsboro;">From 500 to 1000$</td></tr>
                <logic:empty name="user500To1000">
                    <tr><td colspan="3" style="font-style: italic; font-size: 11px;">There are no customer</td></tr>
                </logic:empty>
                <logic:notEmpty name="user500To1000">
                    <logic:iterate name="user500To1000" id="u">
                        <tr><td colspan="3"> <bean:write name="u" property="fullname"/> </td></tr>
                    </logic:iterate>
                </logic:notEmpty>

                <tr><td colspan="3" style="text-align: right; background-color: gainsboro;">From 200 to 500$</td></tr>
                <logic:empty name="user200To500">
                    <tr><td colspan="3" style="font-style: italic; font-size: 11px;">There are no customer</td></tr>
                </logic:empty>
                <logic:notEmpty name="user200To500">
                    <logic:iterate name="user200To500" id="u">
                        <tr><td colspan="3"><bean:write name="u" property="fullname"/></td></tr>
                    </logic:iterate>
                </logic:notEmpty>
            </tbody>
            <!-- /Tbody -->
        </table>
        <!-- /ListTable -->	
    </div>
    <!-- /Inner Content -->
    <div class="bBottom"><div></div></div>
</div>




